package cn.ming.leo.utils;

import java.util.List;
import java.util.Map;

import com.google.gson.Gson;

public class EmailMessage {
	/**
	 * 单条发送
	 */
	public static final String SIMPLE_SINGLE = "simple_single";
	/**
	 * 模版发送
	 */
	public static final String TEMPLATE_SINGLE = "template_single";
	/**
	 * 群发
	 */
	public static final String BATCH_EMAIL = "batch";

	/**
	 * type为BATCH_EMAIL 的时候才需设置这个参数
	 */
	private List<String> addressList;
	private String type;
	private String subject;
	private String content;
	private String template;
	private String toAddress;
	private Map<String, String> parameter;

	// EmailMessage em = new EmailMessage();

	public String getTemplate() {
		return template;
	}

	public EmailMessage() {
	}

	public EmailMessage(List<String> addressList, String type, String subject, String content, String template,
			String toAddress, Map<String, String> parameter) {
		super();
		this.addressList = addressList;
		this.type = type;
		this.subject = subject;
		this.content = content;
		this.template = template;
		this.toAddress = toAddress;
		this.parameter = parameter;
	}

	public void setTemplate(String template) {
		this.template = template;
	}

	public Map<String, String> getParameter() {
		return parameter;
	}

	public void setParameter(Map<String, String> parameter) {
		this.parameter = parameter;
	}

	public String getToAddress() {
		return toAddress;
	}

	public void setToAddress(String toAddress) {
		this.toAddress = toAddress;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public List<String> getAddressList() {
		return addressList;
	}

	public void setAddressList(List<String> addressList) {
		this.addressList = addressList;
	}

	@Override
	public String toString() {
		Gson gson = new Gson();
		return gson.toJson(this);
	}

}
